#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;
const int P = 131 , N = 1e6 + 10;
typedef unsigned long long ULL;
ULL f[N];
ULL p[N];
string s;
int m , n;

void init_hash()
{
    f[0] = 0 , p[0] = 1;
    for(int i = 1;i <= n;i ++)
    {
        f[i] = f[i - 1] * P + s[i];
        p[i] = p[i - 1] * P;
    }
}

ULL get_hash(int l , int r)
{
    return f[r] - f[l - 1] * p[r - l + 1];
}
int main()
{
    cin >> s >> m;
    s = ' ' + s;
    n = s.size();
    init_hash();
    while(m--)
    {
        int l1 , r1 , l2 , r2;
        cin >> l1 >> r1 >> l2 >> r2;
        ULL x = get_hash(l1 , r1) , y = get_hash(l2 , r2);
        if(x == y) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}